package vip.meeet.conversion;

import org.springframework.core.convert.converter.Converter;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class StringToDateConvert implements Converter<String,Date>{

    @Override
    public Date convert(String source) {
        DateFormat format=new SimpleDateFormat("yyyy-MM-dd");
        try {
            return format.parse((String) source);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
